const Koa = require('koa');
// 引入Websocket
const webSocketService = require('./utils/web_socket')
const app = new Koa();
// 服务器总耗时中间件
const resDurationMiddleware = require('./middleware/koa_response_duration')
app.use(resDurationMiddleware)
// 响应头设置
const resHeader = require('./middleware/koa_response_header')
app.use(resHeader)
// 路径处理文件获取
const resData = require('./middleware/koa_response_data')
app.use(resData)
app.listen(8888, () => {
  console.log('server running success.....\nport: 8888')
});

// 开启websocket监听
webSocketService.listen()
